/*
 * $LastChangedDate: 2007-06-12 10:08:07 +0200 (Tue, 12 Jun 2007) $
 * $LastChangedRevision: 186 $
 * $LastChangedBy: david $
 */

public final class Log
{
	public static final int INIT = 1;
	public static final int CONNECTION = 2;
	public static final int IO = 4;
	public static final int LOCK = 8;
	public static int loglevel = INIT | CONNECTION | IO | LOCK;

	public static boolean isEnabled(int lvl)
	{
		if ((Log.loglevel & lvl) != 0) {
			return true;
		}
		return false;
	}

	public static final void println(String s)
	{
		System.out.println(Thread.currentThread() + " :: " +
			Thread.currentThread().getStackTrace()[3].getClassName().toString() +
			"." + Thread.currentThread().getStackTrace()[3].getMethodName()
			+ "(): " + s);
	}

	public static final void println(String s, int logtype)
	{
		if (isEnabled(logtype)) {
			println(s);
		}
	}
}
